<?php

class ShopCreator extends CActiveRecordBehavior {
	
	public function afterSave($event) {
		$model = $this->getOwner();
		if($model->getIsNewRecord()) {
			$shop = new Shop();
			$shop->attributes = array(
				'worker_id' => $model->id,
				'shop_name' => $model->worker_name . '的店铺',
			);
			$shop->save();
		}
	}
	
}